package com.jay.mypracticesdemo

import org.junit.Test

class EncryptTest {
    @Test
    fun testEncrypt() {
//        "uic":function(d){
//            let ut = NotGm.enc.Utf8.parse('2890'+ConFig['config']['uid']+'tB959C'),
//            mm = NotGm.enc.Utf8.parse("2F131BE91247866E"),
//            decrypted = NotGm.BBS.decrypt(d, ut, {iv: mm, mode: NotGm.mode.CBC, padding: NotGm.pad.Pkcs7});
//            return NotGm.enc.Utf8.stringify(decrypted);
//        }
        val uid = "EVbJoF"
        val key = "2890" + uid + "tB959C"
        val iv = "2F131BE91247866E"
        println(iv.length)
        val cipherText = "DHRBjP7hirLF65ORBeRVuXRP2PHvM+6qgiGU72+Aoq3RyZ5La3zGOy8kH6vL7Ew9"
        val decryptSymmetrically = CryptoUtils.decryptSymmetrically(key, iv, cipherText, CryptoUtils.Encryption.AES_CBC_PKCS5)
        print(decryptSymmetrically)
    }
}